﻿<phone:PhoneApplicationPage 
    x:Class="MapABCAPI_WP7.Samples.MapTool"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:Mapabc="clr-namespace:Com.Mapabc.Maps.Api;assembly=Mapabc.WP7.API"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot x:Name="Pivot" Title="{StaticResource ApplicationTitle}">
            <!--Pivot item one-->
            <controls:PivotItem Header="功能">
                <Grid Height="653" Name="grid1" Width="457">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="65" />
                        <ColumnDefinition Width="417" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"  />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="0"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="0">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="在指定位置添加点" Tap="addLocationMarker"  />
                    </HyperlinkButton>

                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="1"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="1">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="计算多点距离" Tap="CalculateDistance" />
                    </HyperlinkButton>


                    <Image Style="{StaticResource ImageMainStyle}" Grid.Row="2"></Image>
                    <HyperlinkButton Style="{StaticResource HyperlinkEmptyStyle}" Grid.Column="1" Grid.Row="2">
                        <TextBlock  Style="{StaticResource TextBlockMainStyle}" Text="经纬度像素坐标互换" Tap="LngLatToContainerPixel"  />
                    </HyperlinkButton>

                </Grid>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="地图示例">
                <Grid>
                    <Mapabc:MMap x:Name="map"/>
                    <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" x:Name="cont">
                        <Border Background="LightGray" BorderBrush="DarkGray" CornerRadius="10" BorderThickness="3" Height="320" Margin="-202,0,0,-274" Width="241" HorizontalAlignment="Left" VerticalAlignment="Bottom">
                            <StackPanel Orientation="Vertical" Margin="20">
                                <StackPanel.Resources>
                                    <Style x:Name="spTextBlockStyle" TargetType="TextBlock">
                                        <Setter Property="FontWeight" Value="Bold"/>
                                        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}" />
                                        <Setter Property="Foreground" Value="Black" />
                                        <Setter Property="MinWidth" Value="150" />
                                    </Style>
                                </StackPanel.Resources>
                                <TextBlock Height="30" Name="textBlock1" Text="经度坐标：" Visibility="Collapsed" />
                                <TextBox Height="59"  Text="116.41" FontSize="12" Width="167"  x:Name ="LngX" Visibility="Collapsed"/>
                                <TextBlock Height="30" Name="textBlock2" Text="纬度坐标：" Visibility="Collapsed"  />
                                <TextBox Height="59"  Text="39.94" FontSize="12" Width="167" x:Name="LatY" Visibility="Collapsed"/>
                                <Button Content="添加点" FontSize="12" Height="62" Name="button1" Width="150" Click="addMarker" Visibility="Collapsed" />
                                <TextBlock Height="30" Name="textBlock3" Text="坐标：" Visibility ="Collapsed"/>
                                <TextBox Height="72"  Text="116.304,39.960;116.30,39.942;116.3307,39.92;" x:Name="CoorsXY" Width="260" Visibility="Collapsed" />
                                <TextBlock Height="30" FontSize="10" Name="textBlock4" Text="计算结果：（单位米）" Visibility="Collapsed" />
                                <TextBox Height="72"  FontSize="10" Text="" Width="260" x:Name="Result" Visibility="Collapsed"/>
                                <Button FontSize="10"  Name="button2" Width="200" Height="72"  Content="计算多点距离" Click="Calculate" Visibility="Collapsed" />
                                <TextBlock Height="30" Name="textBlock5" Text="屏幕坐标：" Visibility="Collapsed"/>
                                <TextBox Height="72" x:Name="Pixel" Text="" Width="260" Visibility="Collapsed"/>
                                <Button Content="转换为经纬度坐标" FontSize="12"  Height="72" Name="button3" Width="160" Click="FromScreenPixelToLngLat" Visibility="Collapsed" />
                                <TextBlock Height="30" Name="textBlock6" Text="经纬度坐标：" Visibility="Collapsed"/>
                                <TextBox Height="72" x:Name="LngLat" Text="" Width="260" Visibility="Collapsed" />
                            </StackPanel>
                        </Border>
                    </Grid>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>


</phone:PhoneApplicationPage>